from django.dispatch import receiver
from django.contrib.auth.models import User
from django.db.models.signals import post_save
#from eface.wechat.models import WxInfo
from .models import Userinfo


@receiver(post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
    if created:
        Userinfo.objects.create(user=instance)
    if instance.first_name =='':
        instance.first_name=instance.username
        instance.save() 



